<?php 
/**
 * 后台订单管理控制器
 */
class OrdersController extends AuthController{
	private $model;
	public function __init(){
		parent::__init();
		$this->model = K('Orders');
		
	}
	/**
	 * 加载首页
	 */	
	
	public function index(){
		$data = $this->model->all();
		$this->assign('data',$data);
		$this->display();
		
		
	}
	
	/**
	 * 显示待处理订单
	 */
	public function untreated(){
		
		$data = $this->model->where("state=1")->all();
		$this->assign('data',$data);	
		$this->display();
	}
	/**
	 * 处理待发货
	 */
	public function doOrder(){
		
		$oid = Q('get.oid',0,'intval');
		if($oid){
			$data = array(
				'oid' 	=> $oid,
				'state' => 2
			);
			$this->model->update($data);
			$this->success('订单已处理');
		}
		
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}





















 ?>